#include "CTaskTargetTrigger.h"
#include "CUserTask.h"

int CTaskTargetTrigger::Trigger(CUserTask& stUserTask, CTaskCond& stCond)
{
    CT_TRACE(("触发器被触发, 事件: 类型 %d , Data1 %d, Data2 %d", 
                stCond._ucCond, stCond._iCondData1, stCond._iCondData2));

    switch(_ucTargetType)
    {
    case TASK_TRIGGER_TARGET_OPEN:
        return stUserTask.UpdateWaitForOpenTask(*this, stCond);
    case TASK_TRIGGER_TARGET_FINISH:
        return stUserTask.UpdateValidTask(*this, stCond);
    default:
        return ERROR_TASK_TRIGGER_TYPE_ERROR;
    }
}

